﻿<%@ Page Language="C#" MasterPageFile="~/JOINT/MstPage_JOINT.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="frmJ_StaffDegreeByCompInput.aspx.cs"
    Inherits="JOINT_frmJ_StaffDegreeByCompInput" Title="Untitled Page" Culture="ja-JP"
    UICulture="ja" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    資格情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="../Style/JsStyle.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../js/jquery.min.js"></script>

    <script src="../js/jquery.blockUI.js" type="text/javascript"></script>

    <script src="../js/Validation.js" type="text/javascript"></script>

    <script language="JavaScript" type="text/javascript">
        function cbleave() {
            ValidatorEnable(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), true);
        }

        function checkcb() {
            ValidatorEnable2(document.getElementById("<%=CustomValidator3.ClientID %>"), true);
            ValidatorEnable2(document.getElementById("<%=CustomValidator10.ClientID %>"), true);
            ValidatorEnable(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), true);
        }
        $(document).ready(function() {
            //  ValidatorEnable(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), false);	  	
            registerControlToValidation("validation");
            registerEnterEvent("next_control", "<%= btn_登録.ClientID %>", 6);
            formatDate("css_text_calender", "/");
            $('.default').each(function() {
                var default_value = this.value;
                $(this).css('color', '#666');
                $(this).focus(function() {
                    if (this.value == default_value) {
                        this.value = '';
                        $(this).css('color', '#333');
                    }
                });
                $(this).blur(function() {
                    if (this.value == '') {
                        $(this).css('color', '#666');
                        this.value = default_value;
                    }
                });
            });

        });

        function validate2DayInput1(oSrc, args) {//Nếu 発令開始日＞発令終了日 thì sẽ thông báo lỗi (đổi màu control)
            var cur = document.getElementById('ctl00_ContentPlaceHolder1_txt_実際開始日').value;
            args.IsValid = checkYearOld(cur, args.Value, 0, "<");
            // ValidatorEnable2(document.getElementById("<%=CustomValidator10.ClientID %>"), true);
        }

        function validate2DayInput2(oSrc, args) {//Nếu 発令開始日＞発令終了日 thì sẽ thông báo lỗi (đổi màu control)
            var cur = document.getElementById('ctl00_ContentPlaceHolder1_txt_発令開始日').value;
            args.IsValid = checkYearOld(cur, args.Value, 0, "<");
            ValidatorEnable2(document.getElementById("<%=CustomValidator2.ClientID %>"), true);
        }
        function validate2DayInput(oSrc, args) {//Nếu 発令開始日＞発令終了日 thì sẽ thông báo lỗi (đổi màu control)
            var cur = document.getElementById('ctl00_ContentPlaceHolder1_txt_発令開始日').value;
            args.IsValid = checkYearOld(cur, args.Value, 0, "<");
        }
        function loseFocusValidate() {
            ValidatorEnable2(document.getElementById("<%=CustomValidator3.ClientID %>"), true);
            ValidatorEnable2(document.getElementById("<%=CustomValidator10.ClientID %>"), true);
        }
        function validateAo(oSrc, args) {
            args.IsValid = true;
            ValidatorEnable2(document.getElementById("<%=CustomValidator3.ClientID %>"), true);
            ValidatorEnable2(document.getElementById("<%=CustomValidator10.ClientID %>"), true);
        }

        function confirmData() {
            var 資格コード =
         document.getElementById('ctl00_ContentPlaceHolder1_ddl_資格コード').value;
            var 発令開始日 = document.getElementById('ctl00_ContentPlaceHolder1_txt_発令開始日').value;
            var 発令終了日 = document.getElementById('ctl00_ContentPlaceHolder1_txt_発令終了日').value;
            var 実際開始日 = document.getElementById('ctl00_ContentPlaceHolder1_txt_実際開始日').value;
            var 実際終了日 = document.getElementById('ctl00_ContentPlaceHolder1_txt_実際終了日').value;
            var 変更理由 = document.getElementById('ctl00_ContentPlaceHolder1_txt_変更理由').value;
            if (資格コード != -1 || 発令開始日 != "" || 発令終了日 != "" || 実際開始日 != "" || 実際終了日 != "" || 変更理由 != "") {
                alert("データが入力しています、キャンセルしてもよろしいですか？");
            }
            if (資格コード == -1 && 発令開始日 == "" && 発令終了日 == "" && 実際開始日 == "" && 実際終了日 == "" && 変更理由 == "") {
                ValidatorEnable(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), false);
                $("#<%=ddl_資格コード.ClientID %>").val("dgdfg");
                return true;
            }
        }
        function clearText() {
            // ValidatorEnable2(document.getElementById("ctl00_ContentPlaceHolder1_RequiredFieldValidator1"), false);
            RemoveInvalid(document.getElementById("<%= RequiredFieldValidator1.ClientID %>"));
            $("#<%=ddl_資格コード.ClientID %>").attr("selectedIndex", 0);
            $("#<%=txt_発令開始日.ClientID %>").val("");
            $("#<%=txt_発令終了日.ClientID %>").val("");
            $("#<%=txt_実際開始日.ClientID %>").val("");
            $("#<%=txt_実際終了日.ClientID %>").val("");
            $("#<%=txt_変更理由.ClientID %>").val("");


        }

    </script>

    <div class="maindiv1">
        <div class="Header1">
            ＊: 必須.</div>
        <div class="NoteStyle">
            ※下記の情報があれば、必須項目を入力してください。なければ、次ボタンを押してください。</div>
        <div>
            &nbsp;</div>
        <div id="div_資格コード" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">資格名 :</span>
            <asp:DropDownList ID="ddl_資格コード" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddl_資格コード_SelectedIndexChanged"
                CssClass=" validation next_control dropdownlist width2"  onclick="cbleave()" >
                <asp:ListItem Value="-1" Selected="true">[選択]</asp:ListItem>
            </asp:DropDownList>
            <span class="required-field">*</span>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="ddl_資格コード"
                Display="None" InitialValue="-1" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1"
                Width="240px" TargetControlID="RequiredFieldValidator1" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator runat="server" ID="CustomValidator資格コード" OnServerValidate="CustomValidate資格コード"
                ErrorMessage="" ControlToValidate="ddl_資格コード" Display="None">
            </asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender6"
                TargetControlID="CustomValidator資格コード" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <Triggers>
                    <%-- <asp:PostBackTrigger ControlID="ddl_職種"/>--%>
                    <asp:AsyncPostBackTrigger ControlID="ddl_資格コード" EventName="SelectedIndexChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <div id="div_発令開始日" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">発令開始日 :</span>
            <asp:TextBox ID="txt_発令開始日" runat="server" ValidationGroup="detailForm"
                MaxLength="8" CssClass="next_control css_text_calender validation textbox width_calendar"
                onkeypress="return InputNumberKeys(this, event)" onfocus="checkcb()" Style="ime-mode: disabled"
                onblur="loseFocusValidate()" onChange="loseFocusValidate()"></asp:TextBox>
            <asp:ImageButton ID="imb_発令開始日" runat="server" CssClass="btn_calendar" ValidationGroup="detailsform"
                ImageUrl="~/Images/calendar.jpg"></asp:ImageButton>
            <span class="required-field">*</span>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txt_発令開始日"
                PopupButtonID="imb_発令開始日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="txt_発令開始日"
                Display="None" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender12"
                Width="240px" TargetControlID="RequiredFieldValidator2" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator4" runat="server" ErrorMessage="" ControlToValidate="txt_発令開始日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender10"
                TargetControlID="CustomValidator4" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="" ControlToValidate="txt_発令開始日"
                ClientValidationFunction="validateAo" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender9"
                TargetControlID="CustomValidator1" HighlightCssClass="invalid1" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div id="div_発令終了日" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">発令終了日 :</span>
            <asp:TextBox ID="txt_発令終了日" MaxLength="8" runat="server" ValidationGroup="detailForm"
                Style="ime-mode: disabled" onfocus="checkcb()" CssClass="next_control css_text_calender validation textbox width_calendar" onkeypress="return InputNumberKeys(this, event)"></asp:TextBox>
                <asp:ImageButton ID="imb_発令終了日" runat="server" CssClass="btn_calendar" ImageUrl="~/Images/calendar.jpg"
                     ValidationGroup="detailsform"></asp:ImageButton>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txt_発令終了日"
                PopupButtonID="imb_発令終了日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:CustomValidator ID="CustomValidator5" runat="server" ErrorMessage="" ControlToValidate="txt_発令終了日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender7"
                TargetControlID="CustomValidator5" HighlightCssClass="invalid1" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator3" runat="server" ErrorMessage="" ControlToValidate="txt_発令終了日"
                ClientValidationFunction="validate2DayInput" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender5"
                TargetControlID="CustomValidator3" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div id="div_実際開始日" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">実際開始日 :</span>
            <asp:TextBox ID="txt_実際開始日" runat="server" MaxLength="8"  ValidationGroup="detailForm"
                Style="ime-mode: disabled" CssClass="next_control css_text_calender validation textbox width_calendar"
                onkeypress="return InputNumberKeys(this, event)" onfocus="checkcb()"></asp:TextBox>
                <asp:ImageButton ID="imb_実際開始日" runat="server" CssClass="btn_calendar" ImageUrl="~/Images/calendar.jpg"
                    Height="19px" ValidationGroup="detailsform"></asp:ImageButton>
                    <span class="required-field">
                * </span>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txt_実際開始日"
                PopupButtonID="imb_実際開始日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="txt_実際開始日"
                Display="None" ErrorMessage="">
            </asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender31"
                Width="240px" TargetControlID="RequiredFieldValidator3" HighlightCssClass="invalid"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator6" runat="server" ErrorMessage="" ControlToValidate="txt_実際開始日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtsender3"
                TargetControlID="CustomValidator6" HighlightCssClass="invalid1" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator10" runat="server" ErrorMessage="" ControlToValidate="txt_実際開始日"
                ClientValidationFunction="validate2DayInput2" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender11"
                TargetControlID="CustomValidator10" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div id="div_実際終了日" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">実際終了日 :</span>
            <asp:TextBox ID="txt_実際終了日" runat="server" MaxLength="8" ValidationGroup="detailForm"
                Style="ime-mode: disabled" CssClass="next_control css_text_calender validation textbox width_calendar"
                onkeypress="return InputNumberKeys(this, event)" onfocus="checkcb()"></asp:TextBox>

                <asp:ImageButton ID="imb_実際終了日" runat="server" CssClass="btn_calendar" ImageUrl="~/Images/calendar.jpg"
                    Height="19px" ValidationGroup="detailsform"></asp:ImageButton>

            <ajaxToolkit:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txt_実際終了日"
                PopupButtonID="imb_実際終了日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <asp:CustomValidator ID="CustomValidator7" runat="server" ErrorMessage="" ControlToValidate="txt_実際終了日"
                ClientValidationFunction="isDate" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4"
                TargetControlID="CustomValidator7" HighlightCssClass="invalid1" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="" ControlToValidate="txt_実際終了日"
                ClientValidationFunction="validate2DayInput1" Display="None"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2"
                TargetControlID="CustomValidator2" HighlightCssClass="invalid" Width="240px"
                CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
        <div id="div_変更理由" class="detail-admin-row" runat="server">
            <span class="detail-admin-label">変更理由:</span>
            <asp:TextBox ID="txt_変更理由" runat="server" ValidationGroup="detailForm" onfocus="checkcb()"
                CssClass=" textarea next_control width3" MaxLength="200" TextMode="MultiLine" Rows="5"></asp:TextBox>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">&nbsp;</span>
            <asp:Button ID="btn_登録" runat="server" Text="登録" CssClass="btn" OnClick="btn_登録_Click"
                OnClientClick="javascript:focusToControlErr();" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btn_リセット" runat="server" Text="リセット" Width="100px" OnClientClick=" return clearText()"
                CausesValidation="false" />
        </div>
    </div>
    <div class="detail-admin-row">
        <div class="btn_back">
            <asp:Button ID="btn_戻る" runat="server" Text="←戻る" OnClick="btn_戻る_Click" Width="100px"
                CausesValidation="false" OnClientClick="return confirmData()"></asp:Button>
        </div>
        <div class="btn_next btn_next_fixedforfrmJ_StaffBasicInfoInput">
            <asp:Button ID="btn_次" runat="server" Text="次→" OnClick="btn_次_Click" Width="100px"
                CausesValidation="false" OnClientClick="return confirmData()"></asp:Button>
        </div>
    </div>
    <div>
        &nbsp;</div>
    <br />
    <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
        <asp:PostBackTrigger ControlID="btn_登録"/>
           <%-- <asp:AsyncPostBackTrigger ControlID="btn_登録" EventName="Click" />--%>
    </Triggers> </asp:UpdatePanel>
</asp:Content>
